Repository navigation
feat(cli): group pdd --help and add pdd autopilot logs --follow (#3496, #3475) - #3506
Open
Serhan-Asad wants to merge 4 commits into
Open
Serhan-Asad wants to merge 4 commits into
Serhan-Asad wants to merge 4 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request makes
pdd --helpeasy to scan and adds a read-onlypdd autopilot logscommand for headless Autopilot workers.Size:
+2984 / -268lines across 16 files.Closes #3496
Closes #3475
Issues:
What Changed
Grouped root
pdd --helpand focused command help (Make pdd --help easier to scan with grouped commands and focused help #3496)pdd,pdd --help,pdd -h,pdd -help,pdd help) now opens with a short summary, aUsage:line, and a 4-lineQuick start:section (pdd setup,pdd test,pdd simulate,pdd help prompting).Core PDD workflow(setup,test,lint,simulate,approve,files,owner,contracts,jobs,mcp,upgrade)Cloud accounts(pdd accounts --help)Workflows & product(pdd workflow --help,pdd product --help)Autopilot(pdd autopilot --help)Metrics, shell & help(pdd metrics --help)pdd --help(includingclosingLines) fits within 80 columns.pdd <command> --help) without repeating on the root page.pdd autopilot start --help.Prompting guideandRUNBOOKpath lines and closing guidance.Read-only
pdd autopilot logsand--follow([alpha] A person cannot follow a headless Autopilot worker through a native attach or live-log command #3475)prompts/cli/autopilot-logs.prompt.md(with## Domain decisions, sole leaf[Secret redaction](secret-redaction.prompt.md)under## Dependencies, and## Caller navigation) andsrc/autopilot-logs.mjs, wired throughrunAutopilotSubcommand('logs', ...)insrc/autopilot.mjsandsrc/pdd-cli.mjs.src/command-catalog.mjs, shell completion, anddocs/cli.md(acceptingN,#N,owner/repo#N, and GitHub issue URLs both positionally and via--issue):pdd autopilot logs [ISSUE] [--follow|-f] [--lines N] [--json]pdd autopilot logs --issue N [--follow|-f] [--lines N] [--json]pdd autopilot logslists current headless workers sorted by issue (stage, owned process state, shared suite queue position, blockers, last activity, and saved log and evidence paths), recent finished workers, and the exact--followcommand.suite-queued), live suite execution with validation logs (suite-running), repair passes (repair), and stale suite receipts or dead worker PIDs (suite-stale).pid > 1and treats anykill(pid, 0)error (ESRCHorEPERM) as not running so PID 1 or non-owned processes are never misclassified as Autopilot workers.Number.isFinite(ts) && Math.abs(ts) <= 8.64e15, aligns tail and follow reads to\nbyte boundaries without dropping trailing-newline tails or splitting UTF-8/secrets mid-line, strips ANSI/control codes, and redacts secrets withredactSecrets(..., knownSecretValues(env))across human,--follow, and--jsonoutputs.--follow(-f) reuses the resolvedgitRootacross polls, handlesstdoutcloseandEPIPEcleanly for piped callers (| head -n 5), enforcesmaxDurationMs(default 60 minutes), and detaches cleanly onCtrl-Cwithout stopping the worker or changingobservemode.No Story: CLI help layout and read-only native Autopilot worker log viewer covered by unit and formal CLI tests.
Verification
Tested locally with isolated
test-home.mjsandtest-net-guard.mjs(103 focused tests passed, 0 failed):pdd owneronsrc/autopilot-logs.mjs,src/autopilot.mjs,src/command-catalog.mjs,src/pdd-cli.mjs: all current, 0 warnings.pdd files --jsonandpdd test --fileson touched prompts and Stories: 0 refusals, 0 dependency cycles onautopilot-logs.prompt.md.pdd lint --local --json: exit code 0.test/grouped-help.test.mjsandtest/autopilot-logs.test.mjstest/docs-commands.test.mjsandtest/docs-first-time.test.mjstest/help-teaches-pdd.test.mjs,test/approval-help.test.mjs,test/cli-help-words.test.mjs,test/cli-preview-help.test.mjs,test/command-catalog.test.mjs,test/file-owner.test.mjstest/new-command-names.formal.test.mjs,test/name-the-interpreter.formal.test.mjs,test/workflow-request-uptake.review.test.mjstest/pdd-cli.test.mjs,test/autopilot-cli.test.mjs,test/autopilot.test.mjs,test/setup.test.mjs,test/interpreter-version.test.mjsALPHA1(test/cli.test.mjs),SEAM5(test/runtime-seam.test.mjs), andcli-catalog-dispatch(test/workflow-request-uptake.vectors.test.mjs).Full
npm testhas not been run on the laptop and will run in CI.